<?php if (!defined('__ACCESS__')) exit;?>
<script>
$(document).ready(function(){
	$('.btn[href=save-or]').click(function(){
		val = 0;
		if($('#or').attr('checked'))
			val = 1;
		$.post('?module=login&action=change',{or:1,val:val},function(data){
			$('#orres').html(data).css('color','blue').fadeOut(2000,function(){$('#orres').html('').show()});		
		});
		return false;
	});
	$('.btn[href=change-pass]').click(function(){
		var pass = $('label[for=pass]').next().find('input').val(),
		pass2 = $('label[for=npass]').next().find('input').val(),
		pass3 = $('label[for=npass2]').next().find('input').val();
		if(pass2 != pass3){
			alert("New Passwords are not identical!");
			return false;
		}
		$.post('?module=login&action=change',{or:0,pass:pass,npass:pass2},function(data){
			$('#passres').html(data).css('color','blue').fadeOut(2000,function(){$('#passres').html('').show()});		
			$('#passchange').find('input[type=password]').val('');
		});
		return false;
	});
	$('#photoupload').click(function(){
		$('.upppp').submit();
	});
});
</script>
<div id="member_settings" title="Settings">
	<div class="content-box"> 
		<h4 class="ui-box-header ui-corner-all">Change Password</h4> 
    	<form id="passchange">
    		<fieldset>
    			<ul>
					<li>
						<label class="desc" for="pass">Password</label>
						<div>
							<input type="password" class="intput field full ui-text-center" />
						</div>
					</li>
					<li>
						<label class="desc" for="npass">New Password</label>
						<div>
							<input type="password" class="intput field full ui-text-center" />
						</div>
					</li>
					<li>
						<label class="desc" for="npass2">Confirm Password</label>
						<div>
							<input type="password" class="intput field full ui-text-center" />
						</div>
					</li>
					<li>
						<span id="passres"></span>
						<a class="custom-float-right btn ui-state-default ui-corner-all" href="change-pass" >
                        		<span class="ui-icon ui-icon-key"></span> 
                        		Change Password
                        </a>
					</li>
    	</form>
					<li>
						<label class="desc" for="npass2">Upload Avatar <small style="font-size:x-small;">(max: 200kb type: png)</small></label>
						<div>
							<form class="upppp" enctype="multipart/form-data" action="?module=login&action=change" method="post">
								<input name="image" accept="image/png" type="file" class="intput field full ui-text-center" />
								<input type="hidden" value="photo" name="upload" />
							</form>
						</div>
					</li>
					<li>
						<a class="custom-float-right btn ui-state-default ui-corner-all" id="photoupload" >
                        		<span class="ui-icon ui-icon-disk"></span> 
                        		Upload
                        </a>
					</li>
				</ul>
    		</fieldset>
	</div>	
</div>